1. Field of the Invention
The present invention presents a method for dynamically adjusting a cache buffer of a solid state drive, and more particularly, a method for managing a cache buffer of a solid state drive by determining if data are continuous and dynamically adjusting the cache buffer when writing the data.
2. Description of the Prior Art
A solid state drive (SSD) conventionally has a number of NAND flash memories combined to form a storage device. The solid state drive has a fixed structure making it suitable to be carried around making transfer of data fast. Thus, the solid state drive is a popular product for transferring large amounts of data.
FIG. 1 illustrates a flowchart of a method of writing data in a solid state drive (SSD) according to prior art. The solid state drive of the prior art receives data having a logical block address (LBA) transmitted from a host, converts the data to logical page data format having logical allocation address (LAA), and temporarily stores the data in a cache buffer (step P1). The cache buffer is searched for same data (step P2). Determine if there is same data (step P3). When there is same data, the same data and the data are merged (step P4). The logical page is randomly allocated to a flash memory and the allocation registered in a mapping table (step P5). Individually transmitting the logical page to the flash memory through a first in first out pipeline and writing the logical page in a memory page of a flash memory (step P6). Thus, the solid state drive of the prior art uses the data temporarily stored in the cache buffer to search for the same data. And, the same data are merged with the data to reduce writing of repeated data to increase the efficiency of writing data.
Then, when the solid state drive of the prior art searches for the same data in the cache buffer, all of the data temporarily stored in the cache buffer has to be searched and compared. If the memory size of the cache buffer is too big, an amount of time is wasted to do the comparison of the temporarily stored data. Thus, the efficiency of writing data is decreased. But, when the predetermined memory size of the cache buffer is too small, because the cache memory is not able to accumulate more temporarily stored data, the chance to find same data during search is reduced. Thus, result in writing of repeated data and the efficiency of writing data is decreased. Therefore, there are still problems to be solved in regard to the solid state drive setting the memory size of the cache buffer.